home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Default Directory
- Sent: 7/3/96 4:59 PM
- Received: 7/3/96 5:01 PM
- From: Henri Lamiraux, lamiraux@apple.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- >Henri,
- >
- >I wrote you a couple of months ago about getting the directory of the part
- >editor, and you said that you would research it further. Have you found a
- >way to do it, yet? If so, would you post the code snippet to do so?
- >
- >Thanks in advance,
- >Scott
- >--
- >Scott Daniels scottdfl@sprynet.com
- >"Life appears the way you choose to see it."
-
- Looks like my first answer was never posted so here it is again:
-
-
- This is a bug in ODF 1. I cannot give you a fix because the bug is in the
- shared library. But the following code extracted from ODF 2 should do
- what you expect (I did not tested it so...)
-
- ------------------------------
-
- FW_OFileSpecification* fileSpec = new FW_OFileSpecification;
-
- FSSpec macFileSpec;
- FInfo fileInfo;
- FW_PascalChar buffer[255];
- FCBPBRec pb;
-
- pb.ioFCBIndx = 0;
- pb.ioVRefNum = 0;
- pb.ioRefNum = gInstance->fRefNum;
- pb.ioNamePtr = buffer;
- OSErr err = ::PBGetFCBInfoSync(&pb);
- if (err != noErr)
- {
- buffer[0] = 0;
- pb.ioFCBVRefNum = 0;
- pb.ioFCBParID = 0;
- }
-
- ::FSMakeFSSpec(pb.ioFCBVRefNum, pb.ioFCBParID, buffer, &macFileSpec);
- ::FSpGetFInfo(&macFileSpec, &fileInfo);
-
- fileSpec->AssignFileSpec(ev, &macFileSpec);
- fileSpec->MacSetTypeAndCreator(ev, fileInfo.fdType, fileInfo.fdCreator);
-
- FW_PFileSpecification shLibFileSpec(ev, fileSpec);
- FW_PDirectorySpecification libDir(ev,
- shLibFileSpec->GetParentDirectory(ev));
- FW_CString path;
- libDir->GetFullPath(ev, path);
-
-
- ........................................................................
- Henri Lamiraux lamiraux@apple.com
- Apple Computer, Inc. OpenDoc(tm) Development Framework
- ........................................................................
-
-
-